home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / sbar.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  1KB  |  45 lines

  1. #ifndef __SCROLLBAR_H_
  2. #define __SCROLLBAR_H_
  3.  
  4. #include "meter.h"
  5. #include <dos.h>
  6.  
  7. enum ORIENT { HORIZ, VERT };
  8.  
  9. class ScrollBar : public Visible
  10.     {
  11.     protected:
  12.         int act;              // Visible or not.
  13.         int len;              // Vertical or Horizontal size, TEXT.
  14.         loc pos;              // Left - top.
  15.         int current;          // Cursor position, absolute.
  16.         int total_len;        // Total number of steps, absolute.
  17.         ORIENT direction;     // 0 - horiz., 1 - vert.
  18.         int pattern;
  19.         Element* e1;
  20.     Element* e2;      // Buttons.
  21.         int page_size;
  22.     public:
  23.         ScrollBar(loc pos, ORIENT type, int len,
  24.         int tot, int page_size, int cur = 0, int pattern = 0);
  25.  
  26.         virtual ~ScrollBar() { delete e1; delete e2; }
  27.         virtual void meter_show(loc m, int meter_len, ORIENT direction,
  28.             int p, int pattern);
  29.         int get_pos() { return current; }
  30.         virtual void decrease();
  31.         virtual void increase();
  32.         virtual int get_screen_pos(int meter_len);
  33.         void set_pos(int cur) { current = cur; }
  34.         virtual void repose(rect new_coord);
  35.         void set_page_size(int p) { page_size = p; }
  36.         void set_total(int tot) { total_len = tot; }
  37.  
  38.         virtual void show();
  39.         virtual void exe(int act = 0);
  40.         virtual rect bound();
  41.         void set_act(int a) { act = a; }
  42.         int mouse_in(loc where);
  43.     };
  44.  
  45. #endif __SCROLLBAR_H_